<!--
 * @Author: Leo.wang wanglizhigs@163.com
 * @Date: 2023-12-01 09:38:06
 * @LastEditors: Leo.wang wanglizhigs@163.com
 * @LastEditTime: 2023-12-05 21:48:18
 * @FilePath: /sports_helper/src/pages/result/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="page">
    <van-form class="van-form-result">
      <van-field>
        <template #input>
          <p class="font_lighter">{{ result.Introduce || '' }}</p>
        </template>
      </van-field>
      <van-field label="运动方式">
        <template #input>
          <p>{{ result.ExerciseModes || '' }}</p>
        </template>
      </van-field>
      <van-field label="运动时间">
        <template #input>
          <p>{{ result.ExerciseTime || '' }}</p>
        </template>
      </van-field>
      <van-field label="运动频率">
        <template #input>
          <p>{{ result.ExerciseFrequency || '' }}</p>
        </template>
      </van-field>
      <van-field label="周运动量">
        <template #input>
          <p>{{ result.WeeklyExerciseVolume || '' }}</p>
        </template>
      </van-field>

      <van-field label="运动强度">
        <template #input>
          <p>{{ result.ExerciseIntensity || '' }}</p>
        </template>
      </van-field>
      <van-field label="实施方法">
        <template #input>
          <div>
            <p v-for="item in result.Implementation || []">{{ item }}</p>
          </div>
        </template>
      </van-field>
    </van-form>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import data from '../../output.json';

export default defineComponent({
  data() {
    return {
      result: {},
    };
  },
  onLoad: function (option) {
    uni.pageScrollTo({
      scrollTop: 0,
      duration: 0,
    });
    const index = Number(option.index);
    this.result = data[index];
  },
});
</script>

<style lang="scss" scoped>
.font_lighter {
  color: #666666;
}
</style>

